package club.justwill.single.persistence.jpo;

import club.justwill.single.persistence.support.HistoryJpo;
import club.justwill.single.persistence.support.ProjectIncomeBase;

import javax.persistence.*;

/**
 * Created by luoyu on 15-12-24.
 */
@Entity
@Table(name = "project_income_history")
public class ProjectIncomeHistory extends ProjectIncomeBase implements HistoryJpo<ProjectIncome> {

    @Column(name = "project_income_id")
    private Long projectIncomeId;

    @Id
    @Column(name = "sequence")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long sequence;

    public Long getSequence() {
        return sequence;
    }

    public void setSequence(Long sequence) {
        this.sequence = sequence;
    }

    @Override
    public void copy(ProjectIncome obj) {
        super.copyBase(obj);
    }

    public Long getProjectIncomeId() {
        return projectIncomeId;
    }

    public void setProjectIncomeId(Long projectIncomeId) {
        if(projectIncomeId == null) {
            this.projectIncomeId = 0L;
        } else {
            this.projectIncomeId = projectIncomeId;
        }
    }
}
